package com.weijun.keepalive_daemon.process

import android.content.Context

/**
 * @author: weijun
 * date: 2023/7/6
 * description:
 */
interface IProcess {

    fun init(context:Context) : Boolean //初始化文件
    fun onPersistentCreate(context: Context,configs: DaemonConfigs) //持久化进程创建
    fun onDaemonAssistantCreate(context: Context,configs: DaemonConfigs) //守护进程创建
    fun onDaemonDead() //观察进程时，被观察的进程挂了

}

object ProcessHelper {
    @Volatile
    var mDaemonStrategy: IProcess? = null
        private set
        get() {
            if (field == null) {
                field = ProcessImpl()
            }
            return field
        }
}